// import profiles and workflow SHA from core
includeConfig "base.config"

// define workflow params
params {

    help = false
    version = false

    disable_ping = false
    threads = 4

    aws_image_prefix = null
    aws_queue = null

    // feature flags
    snp = false
    sv = false
    mod = false
    cnv = false
    str = false

    // benchmark feature flags
    sv_benchmark = false
    sv_benchmark_vcf = null
    sv_benchmark_bed = null

    // common
    bam = null
    ref = null
    bed = null
    coverage_bed = null
    bam_min_coverage = 20
    downsample_coverage = false
    downsample_coverage_target = 60
    downsample_coverage_margin = 1.1
    depth_window_size = 25000
    haplocheck = false
    mitogenome = null
    igv = false

    /// common
    ubam_map_threads = 8
    ubam_sort_threads = 3
    ubam_bam2fq_threads = 1

    // annotation
    annotation = true

    // snp
    override_basecaller_cfg = null
    clair3_model_path = null // used for overriding the guessed clair3 model
    // clair3 parameters
    sample_name = null
    ctg_name = null
    include_all_ctgs = false
    ref_pct_full = 0.1
    var_pct_full = 0.7
    GVCF = false
    base_err = 0.001
    gq_bin_size = 5
    snp_min_af = 0.08
    indel_min_af = 0.15
    vcf_fn = null
    min_contig_size = 0
    min_mq = 5
    min_cov = 2
    min_qual = 2
    refine_snp_with_sv = true

    // sv
    tr_bed= null
    // filterCalls
    min_sv_length = 30
    min_read_support = "auto"
    min_read_support_limit = 2
    // sniffles2 options
    cluster_merge_pos = 150
    sniffles_args = null

    // qdnaseq cnv
    use_qdnaseq = false
    qdnaseq_bin_size = 500

    // spectre cnv
    spectre_args = null

    // mod
    modkit_args = null
    force_strand = false
    modkit_threads = 4

    //str
    sex = null

    // output
    depth_intervals = false
    phased = false
    output_report = true
    output_xam_fmt = "cram"

    // Integrations
    partner = null

    // nfcore
    monochrome_logs = false
    validate_params = true
    show_hidden_params = false
    schema_ignore_params = 'show_hidden_params,validate_params,monochrome_logs,aws_queue,aws_image_prefix,wf,min_read_support,min_read_support_limit,fastq_only'

    store_dir = null

    wf {
        name = "wf-human-variation"
        template_version = "195cab5"
        example_cmd = [
            "--bam 'wf-human-variation-demo/demo.bam'",
            "--ref 'wf-human-variation-demo/demo.fasta'",
            "--bed 'wf-human-variation-demo/demo.bed'",
            "--sample_name 'DEMO'",
            "--snp",
            "--sv",
            "--mod",
            "--phased"
        ]
        agent = null
    }
}

// this process is inherited from wf-template, which specifies not many CPUs as a conservative baseline.
process {
    withName:mergeBams {
        cpus = 8
    }
}

manifest {
    name            = 'epi2me-labs/wf-human-variation'
    author          = 'Oxford Nanopore Technologies'
    homePage        = 'https://github.com/epi2me-labs/wf-human-variation'
    description     = 'SNV calling, SV calling, modified base calling, CNV calling, and STR genotyping of human samples.'
    mainScript      = 'main.nf'
    nextflowVersion = '>=23.04.2'
    version         = '2.7.1'
}

epi2melabs {
    tags = "wf-human-variation,variant calling,whole genome,human"
    icon = "faIdCard"
}

